package com.ruoyi.purchase.service.impl;

import java.util.List;

import com.ruoyi.purchase.mapper.FirmCommodityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.purchase.domain.FirmCommodity;
import com.ruoyi.purchase.service.IFirmCommodityService;

/**
 * 商品Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-16
 */
@Service
public class FirmCommodityServiceImpl implements IFirmCommodityService 
{
    @Autowired
    private FirmCommodityMapper firmCommodityMapper;

    /**
     * 查询商品
     * 
     * @param id 商品主键
     * @return 商品
     */
    @Override
    public FirmCommodity selectFirmCommodityById(Long id)
    {
        return firmCommodityMapper.selectFirmCommodityById(id);
    }

    /**
     * 查询商品列表
     * 
     * @param firmCommodity 商品
     * @return 商品
     */
    @Override
    public List<FirmCommodity> selectFirmCommodityList(FirmCommodity firmCommodity)
    {
        return firmCommodityMapper.selectFirmCommodityList(firmCommodity);
    }

    /**
     * 新增商品
     * 
     * @param firmCommodity 商品
     * @return 结果
     */
    @Override
    public int insertFirmCommodity(FirmCommodity firmCommodity)
    {
        return firmCommodityMapper.insertFirmCommodity(firmCommodity);
    }

    /**
     * 修改商品
     * 
     * @param firmCommodity 商品
     * @return 结果
     */
    @Override
    public int updateFirmCommodity(FirmCommodity firmCommodity)
    {
        return firmCommodityMapper.updateFirmCommodity(firmCommodity);
    }

    /**
     * 批量删除商品
     * 
     * @param ids 需要删除的商品主键
     * @return 结果
     */
    @Override
    public int deleteFirmCommodityByIds(Long[] ids)
    {
        return firmCommodityMapper.deleteFirmCommodityByIds(ids);
    }

    /**
     * 删除商品信息
     * 
     * @param id 商品主键
     * @return 结果
     */
    @Override
    public int deleteFirmCommodityById(Long id)
    {
        return firmCommodityMapper.deleteFirmCommodityById(id);
    }
}
